
Rsd.define('Rsd.Faith.dialogs.ReportZiJinZongZhangDialog', {
    extend: 'Rsd.view.MajorSubDialog',
    requires: [
        'Rsd.Faith.controls.XiaoQuInput',
        'Rsd.controlEx.MajorSubViewer',
        'Rsd.Faith.stores.ListStore'
    ],
    title:'账面详情',
    sub: {
        fk:'XiaoQuBianHao',
        toolBar:{
            xtype:'grid-tool-bar-simple',
            newButtons:[
                {xtype:'label',text:'★ 下方列表为该所属期小区账目明细👇'}
            ]},
        columns: [
            {
                "text": "序号",
                "xtype": "index",
                "width": 40,
                "index": 0
            },
            {
                "name": "XiaoQuBianHao",
                "dataIndex": "XiaoQuBianHao",
                "sortable": false,
                "text": "小区",
                "index": 23,
                "exist": true,
                "xtype": 'ctrl-xiaoqu',
                "width": 150,
                "nobr": true
            },

            {
                "name": "QiChuJinE_ZZ",
                "dataIndex": "QiChuJinE_ZZ",
                "sortable": false,
                "text": "期初(住房)",
                "index": 26,
                "exist": true,
                "xtype": "number",
                "width": 100,
                "precision": 0
            },

            {
                "name": "JiaoCunJinE_ZZ",
                "dataIndex": "JiaoCunJinE_ZZ",
                "sortable": false,
                "text": "缴存(住房)",
                "index": 28,
                "exist": true,
                "xtype": "number",
                "width": 100,
                "precision": 2
            },

            {
                "name": "ShiYongJinE_ZZ",
                "dataIndex": "ShiYongJinE_ZZ",
                "sortable": false,
                "text": "使用(住房)",
                "index": 32,
                "exist": true,
                "xtype": "number",
                "width": 100,
                "precision": 2
            },
            {
                "name": "ZhuZhaiWeiXiZiJinYuE",
                "dataIndex": "ZhuZhaiWeiXiZiJinYuE",
                "sortable": false,
                "text": "余额(住房)",
                "index": 40,
                "exist": true,
                "xtype": "number",
                "width": 100,
                "precision": 2
            },
            {
                "name": "ShouYiJinE_ZZ",
                "dataIndex": "ShouYiJinE_ZZ",
                "sortable": false,
                "text": "统筹账户",
                "index": 30,
                "exist": true,
                "xtype": "number",
                "width": 100,
                "precision": 2
            },
            /*{
                "name": "QiChuJinE_DT",
                "dataIndex": "QiChuJinE_DT",
                "sortable": false,
                "text": "期初(电梯/消防)",
                "index": 27,
                "exist": true,
                "xtype": "number",
                "width": 100,
                "precision": 0
            },
            {
                "name": "JiaoCunJinE_DT",
                "dataIndex": "JiaoCunJinE_DT",
                "sortable": false,
                "text": "缴存(电梯/消防)",
                "index": 34,
                "exist": true,
                "xtype": "number",
                "width": 100,
                "precision": 2
            },
            {
                "name": "ShouYiJinE_DT",
                "dataIndex": "ShouYiJinE_DT",
                "sortable": false,
                "text": "增值(电梯/消防)",
                "index": 36,
                "exist": true,
                "xtype": "number",
                "width": 100,
                "precision": 2
            },
            {
                "name": "ShiYongJinE_DT",
                "dataIndex": "ShiYongJinE_DT",
                "sortable": false,
                "text": "使用(电梯/消防)",
                "index": 38,
                "exist": true,
                "xtype": "number",
                "width": 100,
                "precision": 2
            },

            {
                "name": "YuE_DT",
                "dataIndex": "YuE_DT",
                "sortable": false,
                "text": "余额(电梯/消防)",
                "index": 42,
                "exist": true,
                "xtype": "number",
                "width": 100,
                "precision": 2
            }*/
        ]
    },
    major: {
        modelType:'Rsd.Faith.Models.InfoXiaoQuWuYeBiaoModel',
        height:200,
        legend: '基本信息',
        key:'SuoShuQi',
        "fields":[
            {
                "name": "SuoShuQi",
                "label": {
                    "width": 100,
                    "content": "所属期"
                },
                "dataIndex": "SuoShuQi",
                "index": 22,
               "exist": true,
                width:350,
                "xtype": "text",
                "length": 20
            },
            {
                "name": "KaiShiRiQi",
                "label": {
                    "width": 100,
                    "content": "开始日期"
                },
                "dataIndex": "KaiShiRiQi",
                "index": 23,
               "exist": true,width:350,
                "xtype": "date",
                "formatString": "yyyy-MM-dd"
            },
            {
                "name": "JieShuRiQi",
                "label": {
                    "width": 100,
                    "content": "结束日期"
                },
                "dataIndex": "JieShuRiQi",
                "index": 24,
               "exist": true,width:350,
                "xtype": "date",
                "formatString": "yyyy-MM-dd"
            },
            {
                "name": "QiChuJinE_ZZ",
                "label": {
                    "width": 100,
                    "content": "期初(住房)"
                },
                "dataIndex": "QiChuJinE_ZZ",
                "index": 25,
               "exist": true,width:350,
                "xtype": "number",
                "precision": 2
            },
            {
                "name": "JiaoCunJinE_ZZ",
                "label": {
                    "width": 100,
                    "content": "缴存(住房)"
                },
                "dataIndex": "JiaoCunJinE_ZZ",
                "index": 28,
               "exist": true,width:350,
                "xtype": "number",
                "precision": 2
            },
            {
                "name": "ShiYongJinE_ZZ",
                "label": {
                    "width": 100,
                    "content": "使用(住房)"
                },
                "dataIndex": "ShiYongJinE_ZZ",
                "index": 32,
               "exist": true,width:350,
                "xtype": "number",
                "precision": 2
            },
            {
                "name": "YuE_ZZ",
                "label": {
                    "width": 100,
                    "content": "余额(住房)"
                },
                "dataIndex": "YuE_ZZ",
                "index": 40,
                "exist": true,width:350,
                "xtype": "number",
                "precision": 2
            },
            {
                "name": "ShouYiJinE_ZZ",
                "label": {
                    "width": 100,
                    "content": "统筹账户"
                },
                "dataIndex": "ShouYiJinE_ZZ",
                "index": 30,
                "exist": true,width:350,
                "xtype": "number",
                "precision": 2
            },
           /* {
                "name": "QiChuJinE_DT",
                "label": {
                    "width": 100,
                    "content": "期初(电梯/消防)"
                },
                "dataIndex": "QiChuJinE_DT",
                "index": 26,
                "exist": true,width:350,
                "xtype": "number",
                "precision": 2
            },
            {
                "name": "JiaoCunJinE_DT",
                "label": {
                    "width": 100,
                    "content": "缴存(电梯/消防)"
                },
                "dataIndex": "JiaoCunJinE_DT",
                "index": 34,
               "exist": true,width:350,
                "xtype": "number",
                "precision": 2
            },
            {
                "name": "ShouYiJinE_DT",
                "label": {
                    "width": 100,
                    "content": "增值(电梯/消防)"
                },
                "dataIndex": "ShouYiJinE_DT",
                "index": 36,
               "exist": true,width:350,
                "xtype": "number",
                "precision": 2
            },
            {
                "name": "ShiYongJinE_DT",
                "label": {
                    "width": 100,
                    "content": "使用(电梯/消防)"
                },
                "dataIndex": "ShiYongJinE_DT",
                "index": 38,
               "exist": true,width:350,
                "xtype": "number",
                "precision": 2
            },

            {
                "name": "YuE_DT",
                "label": {
                    "width": 100,
                    "content": "余额(电梯/消防)"
                },
                "dataIndex": "YuE_DT",
                "index": 42,
               "exist": true,width:350,
                "xtype": "number",
                "precision": 2
            },*/
            {
                "name": "ZhuangTai",
                "label": {
                    "width": 100,
                    "content": "状态"
                },
                "dataIndex": "ZhuangTai",
                "index": 44,
                "exist": true,width:350,
                "xtype": "combobox-enum",
                "enum": "Rsd.Faith.Report.ZhuangMuZhuangTai",
                "length": 10
            },
            {
                "name": "Remark",
                "label": {
                    "width": 100,
                    "content": "备注"
                },
                "dataIndex": "Remark",
                "index": 200,
               "exist": true,width:350,
                "xtype": "text",
                "length": 100
            }
        ]

    },
    width: 1200,
    height: 800,
    showClose:true,
    /*
     *
     * */
    constructor :function constructor(config) {
        config = config || {};
        this.apply(config);

    },


    load:function load(row) {


        var me = this;
        var _row = row||this.data;
        if( Rsd.isString(_row))
        {
            /*var _bian_hao = _row;
            Rsd.create('Rsd.Faith.stores.XiaoQuStore',{}).load(this.major.modelType,_bian_hao,function (data) {
                //console.log(data);

                Rsd.app.getService('info.getloudonglist').requestJson({xiaoqubianhao:_bian_hao},function(list ){
                    //console.log(data);
                    me.callParentFn('load',[data.data,list.data]);

                });
            });*/
        }else
        {
            var _suo_shu_qi = _row['SuoShuQi'];

            Rsd.app.getService('biz.getlist').requestJson({
                modelType:'Rsd.Faith.Models.ReportXiaoQuZhangMuModel',
                where:[{name:'SuoShuQi',value:_suo_shu_qi,op:'equals'}],
                sort:[{name:'SuoShuQi',direction:'asc'}]
            },function(data ){
                console.log(data);
                me.callParentFn('load',[_row,data.data.rows]);

            });

        }

    }
});